<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
            "http://www.w3.org/TR/html4/loose.dtd">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="/css/admin.css">
	<title>Firmware upgrade.</title>
	<script type="text/javascript" src="/jsolait/jsolait.js"></script>
	<script type="text/javascript">jsolait.baseURI="/jsolait/";</script>
	<script type="text/javascript">
		var serviceURL = "/rpc.cgi";
		var methods = [ "misc.getVersion" ];
		var jsonrpc=null;
		try {
			jsonrpc = imprt("jsonrpc");
		} catch(e) {
			alert(e);
		}

		function getVersion() {
			try {
				var service = new jsonrpc.ServiceProxy(serviceURL, methods);
				var str_rsp = service.misc.getVersion( ) ;
				document.getElementById('gv').innerHTML+=str_rsp ;
				return str_rsp ;
			} catch(e) {
				document.getElementById('gv').innerHTML+=e ;
			}
			return true ;
		}

		function startUpload () {
			document.form1.call1.value = jsonrpc.JSONRPCMethod("a").jsonRequest(1,"misc.fileUpload", {script:"/access_node/firmware/web_upgrade.sh"}) ;
			return 1 ;
		}

	</script>
</head>

<body>
	<div id="gv"> Current version: <script type="text/javascript"> getVersion(); </script> </div>

	<div id="em"><span>Path to firmware file:</span>
	<form name="form1" action="/rpc.cgi" enctype="multipart/form-data" method="POST" target="iFrame">
		<input type='hidden' name='call1' id='call1'>
		<input type='file' name='figure2' value='2'>
		<input value="Load" type="submit" onClick="javascript:startUpload();"/>
	</form >
	</div>
	<div id="result"> </div>
	<iframe src="about:blank" id="iFrame" name="iFrame"  style="display:none; visibility:hidden;"></iframe>
</body>
</html>
